
package com.cy.model;

import com.cy.BasicModel;

import java.util.ArrayList;
import java.util.List;
import com.cy.ext.plugin.tablebind.TableBind;

import java.util.Date;

/**
* Created with IntelliJ IDEA.
* User: Administrator
* Date: 13-9-9
* Time: 下午12:56
* To change this template use File | Settings | File Templates.
*/
@SuppressWarnings("serial")
@TableBind(tableName="user_map_device",pkName = "id")
public class UserMapDevice extends BasicModel<UserMapDevice> {
    public static final UserMapDevice dao = new UserMapDevice();
    public static final String SELECT_ALL = "`id`,`user_id`,`device_id`,`create_time`,`manage_level`,";

    public UserMapDevice findByUserAndDevice(long userId,long deviceId){
        return findFirst("SELECT * FROM user_map_device WHERE user_id = ? AND device_id = ?",userId,deviceId);
    }
    
        public UserMapDevice setId (Long id){
        this.set("id",id);
        return this;
    }

    public Long getId (){
        return this. get("id");
    }

        public UserMapDevice setUserId (Long userId){
        this.set("user_id",userId);
        return this;
    }

    public Long getUserId (){
        return this. get("user_id");
    }

        public UserMapDevice setDeviceId (Long deviceId){
        this.set("device_id",deviceId);
        return this;
    }

    public Long getDeviceId (){
        return this. get("device_id");
    }

        public UserMapDevice setCreateTime (Date createTime){
        this.set("create_time",createTime);
        return this;
    }

    public Date getCreateTime (){
        return this.getDate("create_time");
    }

        public UserMapDevice setManageLevel (Long manageLevel){
        this.set("manage_level",manageLevel);
        return this;
    }

    public Long getManageLevel (){
        return this. get("manage_level");
    }
}
